package com.example.demo.controller;

import com.example.demo.Utils.Result;
import com.example.demo.entity.Point;
import com.example.demo.service.PointService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author: lu
 * @Date: 2024-08-29-18:37
 * @Description:
 */
@RestController
@RequestMapping("/point")
@Api(tags = "测点")
public class PointController {

    @Autowired
    PointService pointService;

    @PostMapping("/latest")
    @ApiOperation("单测点最新实时值")
    public Result<Object> findPoint(@RequestBody Point point){
        List<Point> point1 = pointService.findPoint(point);
        return Result.success(point1);

    }
}
